package com.yuyu.bean;

public class Product {
    private Integer id;
    private String bar_code;
    private String name;
    private String unit;
    private Double price;
    private Integer amount;
    private Integer classify_id;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBar_code() {
        return bar_code;
    }

    public void setBar_code(String bar_code) {
        this.bar_code = bar_code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getClassify_id() {
        return classify_id;
    }

    public void setClassify_id(Integer classify_id) {
        this.classify_id = classify_id;
    }

    @Override
    public String toString() {
        return "Product [id=" + id + ", bar_code=" + bar_code + ", name=" + name + ", unit=" + unit
                + ", price=" + price + ", amount=" + amount + ", classify_id=" + classify_id + "]";
    }

    @Override
    public int hashCode() {
        return bar_code.hashCode()+id;
    }

    @Override
    public boolean equals(Object obj) {
        Product product = (Product) obj;
        return this.id == product.getId() && this.bar_code.equals(((Product) obj).getBar_code());
    }
}
